/**
 *     This file is part of cesm-ws.
 *
 *     cesm-ws, Web Service for Community Earth System Model
 *
 *     Copyright (c) 2010, Purdue University and/or affilicates or thrid-party contributors as
 *     indicated by the @author tags or express copyright attribution statements
 *     applied by the authors. All third-party contributions are distributed under
 *     license by Purdue University.
 *
 *     cesm-ws is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with this distribution.  If not, see <http://www.gnu.org/licenses/>.
 */

package edu.purdue.rcac.grid.submit;

/**
 * Response bean that each service dispatcher receive from submitter
 * 
 * @author Han Zhang
 * 
 */
public class SubmitterResponse {
	public enum Outcome {
		SUCCESS, FAIL, UNKNOWN
	};

	/**
	 * Outcome enum value indicates if action is successfully invoked
	 */
	private Outcome outcome;

	/**
	 * Action result field
	 */
	private String result;

	/**
	 * Action log field
	 */
	private String log;

	/**
	 * Action error field
	 */
	private String error;

	private String jobDescription;

	public String getJobDescription() {
		return jobDescription;
	}

	public void setJobDescription(String jobDescription) {
		this.jobDescription = jobDescription;
	}

	public String getError() {
		return error;
	}

	public void setError(String error) {
		this.error = error;
	}

	public Outcome getOutcome() {
		return outcome;
	}

	public void setOutcome(Outcome outcome) {
		this.outcome = outcome;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getLog() {
		return log;
	}

	public void setLog(String log) {
		this.log = log;
	}

	public SubmitterResponse() {
		this.outcome = Outcome.UNKNOWN;
		this.result = "";
		this.error = "";
		this.jobDescription = "";
		this.log = "";
	}
	
	public SubmitterResponse(Outcome outcome){
		this();
		this.outcome = outcome;
	}

	public String toString() {
		return String.format("<SubmitterResponse>\n" + " outcome: %s\n"
				+ "result: %s\n" + "error: %s\n" + "log: %s", this.outcome,
				this.result, this.error, this.log);
	}
}
